package com.youku.component.procedure;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.youku.component.result.ExecuteResult;
import com.youku.component.result.QueryExecuteResult;

public class QuerySQLExecutor extends SQLExecutor {
	
	private static final Logger logger=LoggerFactory.getLogger(QuerySQLExecutor.class);

	@Override
	protected ExecuteResult execute() {
		try {
			ResultSet rs = prepareStatement().executeQuery();
			logger.info("向数据库发送了查询sql语句:{}",sql);
			return new QueryExecuteResult(rs);
		} catch (SQLException e) {
			throw new RuntimeException(e);
		}
	}

}
